package  SEApp.components.propertyCtrls {
	import UIFree.graphicTools.color.uif_rgbPalette;
	import UIFree.uif_component;
	
	import flash.events.Event;
	import flash.geom.Rectangle;
	
	public class c_colorCtrl extends c_propertyBase {
		public static const WEIGHT: Number = 140;
		
		private var _palette: uif_rgbPalette;
		public function c_colorCtrl(parent:uif_component, aData:Object, y:Number, a_height:Number) {
			super(parent, aData, y, a_height);
		}
		
		override protected function createComponents():void {
			super.createComponents();
			var rect: Rectangle = componentRect;
			
			_palette = new uif_rgbPalette(this, rect.x, rect.y, rect.width, rect.height, 'paletteCtrl');
			_palette.addEvent(Event.CHANGE, doChange);
		}
		
		override protected function setData(value:Object):void {
			super.setData(value);
			_palette.selectColor = _data.value;
		}
		
		override protected function getValue():Object {
			return _palette.selectColor;
		}
	}
}